﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace DCT.View
{
    [ValueConversion(typeof(bool), typeof(Brush))]
    public class BoolToFillBrushConverter : IValueConverter
    {
        public object Convert(object value, Type typeTarget, object param, CultureInfo culture)
        {
            if (typeTarget == typeof(Brush))
            {
                return (bool)value ? new SolidColorBrush(Color.FromArgb(127, 255, 255, 0)) : Brushes.Transparent;
            }

            return null;
        }
        public object ConvertBack(object value, Type typeTarget, object param, CultureInfo culture)
        {
            return null;
        }
    }
}
